<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const arr = [
        {
          type: '环境噪声',
          mac: '00:12:4b:00:08:bb:2d:1c',
          value: '51.0',
          longitudeAndLatitude: '123.493366,41.728402',
          position: [123.493366, 41.728402],
          upLqi: '100',
          downLqi: '50',
          reportInterval: '20',
          status: 1,
          createTime: '2022-08-19 14:07:01'
        },
        {
          type: '人体红外',
          mac: '00:12:4b:00:08:f1:8f:0b',
          value: '1.0',
          longitudeAndLatitude: '123.494181,41.727709',
          position: [123.494181, 41.727709],
          upLqi: '100',
          downLqi: '50',
          reportInterval: '20',
          status: 1,
          createTime: '2022-08-19 14:07:01'
        },
        {
          type: '激光测距',
          mac: '00:12:4b:00:04:20:76:40',
          value: '0.7075',
          longitudeAndLatitude: '123.49351,41.728434',
          position: [123.49351, 41.728434],
          upLqi: '100',
          downLqi: '50',
          reportInterval: '20',
          status: 1,
          createTime: '2022-08-19 14:07:01'
        },
        {
          type: '横波',
          mac: '00:12:4b:00:04:20:82:ec',
          value: '0.054552',
          longitudeAndLatitude: '123.494036,41.727601',
          position: [123.494036, 41.727601],
          upLqi: '100',
          downLqi: '50',
          reportInterval: '20',
          status: 1,
          createTime: '2022-08-19 14:07:01'
        },
        {
          type: '纵波',
          mac: '00:12:4b:00:08:f1:8c:9f',
          value: '0.998347',
          longitudeAndLatitude: '123.493881,41.727597',
          position: [123.493881, 41.727597],
          upLqi: '100',
          downLqi: '50',
          reportInterval: '20',
          status: 1,
          createTime: '2022-08-19 14:07:01'
        },
        {
          type: '金属探测',
          mac: '00:12:4b:00:04:20:77:48',
          value: '0.0',
          longitudeAndLatitude: '123.494256,41.727953',
          position: [123.494256, 41.727953],
          upLqi: '100',
          downLqi: '50',
          reportInterval: '20',
          status: 1,
          createTime: '2022-08-19 14:07:01'
        }
      ]

      const lgtlat = [123.493366, 41.728402].join()
      function handler(arr) {
        return arr.filter((item) => item.longitudeAndLatitude === lgtlat)[0]
      }
      const res = handler(arr)
      console.log(res)
    </script>
  </body>
</html>
